﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine.UI;
using UnityEngine;


class TutorialPromptBoxNode : TutorialNode
{
    [JsonAttribute("text", "展示文本")]
    public string showText = "";

    [JsonAttribute("pos", "提示框出现位置(屏幕比例)")]
    public Vector2 showPos = new Vector2(0, 0);

    [JsonAttribute("type", "尖角出现位置")]
    public TutorialUIManager.PromptType showType;

    [JsonAttribute("move", "提示框移动", "anim")]
    public bool _isPromptMove;

    [JsonAttribute("range", "移动幅度(单位:像素)", "move")]
    public float _moveRange = 0;

    protected override void Cancel()
    {
        TutorialUIManager.Instance.HidePromptBox();
    }

    protected override void Init()
    {
        var uiRoot = Hope.UIManager.Instance.UIRoot;
        var rootCanvas = uiRoot.GetComponent<Canvas>();
        TutorialUIManager.Instance.ShowPromptBox(TextReadUtils.GetRightTextFromText( showText), rootCanvas, showPos, showType, _isPromptMove, _moveRange);
    }
}

